
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.3.2 rancher · Ebook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="zq_sdk@163.com">
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-tree/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../swarm/swarm.html" />
    
    
    <link rel="prev" href="../k8s/k8s.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"TIME-GATE/","types":["star","watch"],"size":"large"};
    </script>

    
    <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    简介
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../../../about_me.html">
            
                <a href="../../../about_me.html">
            
                    
                    关于
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../../../gitbook_install.html">
            
                <a href="../../../gitbook_install.html">
            
                    
                    附:Gitbook安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../../">
            
                <a href="../../../">
            
                    
                    一 基础理论
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../../data_structure/">
            
                <a href="../../../data_structure/">
            
                    
                    1 数据结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../../../data_structure/11_linear_structure.html">
            
                <a href="../../../data_structure/11_linear_structure.html">
            
                    
                    1.1 数组、链表、跳表及字典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1.1" data-path="../../../data_structure/111_array.html">
            
                <a href="../../../data_structure/111_array.html">
            
                    
                    1.1.1 数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.2" data-path="../../../data_structure/112_link_list.html">
            
                <a href="../../../data_structure/112_link_list.html">
            
                    
                    1.1.2 链表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.3" data-path="../../../data_structure/113_skip_list.html">
            
                <a href="../../../data_structure/113_skip_list.html">
            
                    
                    1.1.3 跳表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.4" data-path="../../../data_structure/114_dictionary.html">
            
                <a href="../../../data_structure/114_dictionary.html">
            
                    
                    1.1.4 字典
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../../../data_structure/12_stack_and_queue.html">
            
                <a href="../../../data_structure/12_stack_and_queue.html">
            
                    
                    1.2 栈、队列、散列及集合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.2.1" data-path="../../../data_structure/121_stack.html">
            
                <a href="../../../data_structure/121_stack.html">
            
                    
                    1.2.1 栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.2" data-path="../../../data_structure/122_queue.html">
            
                <a href="../../../data_structure/122_queue.html">
            
                    
                    1.2.2 队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.3" data-path="../../../data_structure/123_hash.html">
            
                <a href="../../../data_structure/123_hash.html">
            
                    
                    1.2.3 散列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.4" data-path="../../../data_structure/124_set.html">
            
                <a href="../../../data_structure/124_set.html">
            
                    
                    1.2.4 集合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="../../../data_structure/13_tree_and_forest.html">
            
                <a href="../../../data_structure/13_tree_and_forest.html">
            
                    
                    1.3 树与森林
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.3.1" data-path="../../../data_structure/131.html">
            
                <a href="../../../data_structure/131.html">
            
                    
                    1.3.1 二叉搜索树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3.2" data-path="../../../data_structure/132.html">
            
                <a href="../../../data_structure/132.html">
            
                    
                    1.3.2 红黑树
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.4" data-path="../../../data_structure/14_map.html">
            
                <a href="../../../data_structure/14_map.html">
            
                    
                    1.4 图结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.4.1" data-path="../../../data_structure/141_minimal_tree.html">
            
                <a href="../../../data_structure/141_minimal_tree.html">
            
                    
                    1.4.1 最小生成树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.2" data-path="../../../data_structure/142_single_source_shortest_path.html">
            
                <a href="../../../data_structure/142_single_source_shortest_path.html">
            
                    
                    1.4.2 单源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.3" data-path="../../../data_structure/143_all_source_shortest_path.html">
            
                <a href="../../../data_structure/143_all_source_shortest_path.html">
            
                    
                    1.4.3 多源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.4" data-path="../../../data_structure/144_max_stream.html">
            
                <a href="../../../data_structure/144_max_stream.html">
            
                    
                    1.4.4 最大流
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../../">
            
                <a href="../../../">
            
                    
                    2 基础算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../../../algorithm/21.html">
            
                <a href="../../../algorithm/21.html">
            
                    
                    2.1 排序查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../../../algorithm/22.html">
            
                <a href="../../../algorithm/22.html">
            
                    
                    2.2 动态规划
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../../algorithm/distributed_algorithm.html">
            
                <a href="../../../algorithm/distributed_algorithm.html">
            
                    
                    3 分布式算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="../cs/theory.html">
            
                <a href="../cs/theory.html">
            
                    
                    3.1 一致性模式与理论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="../../../algorithm/raft.html">
            
                <a href="../../../algorithm/raft.html">
            
                    
                    3.2 Raft协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="../../../algorithm/paxos.html">
            
                <a href="../../../algorithm/paxos.html">
            
                    
                    3.3 Paxos协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="../../../algorithm/gossip.html">
            
                <a href="../../../algorithm/gossip.html">
            
                    
                    3.4 Gossip协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="../cs/plan.html">
            
                <a href="../cs/plan.html">
            
                    
                    3.5 几种一致性方案
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../../optimization_se/">
            
                <a href="../../../optimization_se/">
            
                    
                    4 运筹及系统工程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="../../../optimization_se/linear_programming.html">
            
                <a href="../../../optimization_se/linear_programming.html">
            
                    
                    4.1 线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="../../../optimization_se/integer_programming.html">
            
                <a href="../../../optimization_se/integer_programming.html">
            
                    
                    4.2 整数规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="../../../optimization_se/目标规划.html">
            
                <a href="../../../optimization_se/目标规划.html">
            
                    
                    4.3 目标规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="../../../optimization_se/非线性规划.html">
            
                <a href="../../../optimization_se/非线性规划.html">
            
                    
                    4.4 非线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.5" data-path="../../../optimization_se/动态规划.html">
            
                <a href="../../../optimization_se/动态规划.html">
            
                    
                    4.5 动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.6" data-path="../../../optimization_se/排队论.html">
            
                <a href="../../../optimization_se/排队论.html">
            
                    
                    4.6 排队论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.7" data-path="../../../optimization_se/博弈论.html">
            
                <a href="../../../optimization_se/博弈论.html">
            
                    
                    4.7 博弈论
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二 工程应用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../design_pattern/">
            
                <a href="../../design_pattern/">
            
                    
                    1 设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../../design_pattern/strategy.html">
            
                <a href="../../design_pattern/strategy.html">
            
                    
                    1.1 策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../../design_pattern/prototype.html">
            
                <a href="../../design_pattern/prototype.html">
            
                    
                    1.2 原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../../design_pattern/singleton.html">
            
                <a href="../../design_pattern/singleton.html">
            
                    
                    1.3 单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../../design_pattern/factory.html">
            
                <a href="../../design_pattern/factory.html">
            
                    
                    1.4 工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../../design_pattern/bridge.html">
            
                <a href="../../design_pattern/bridge.html">
            
                    
                    1.5 桥接模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../../design_pattern/composite.html">
            
                <a href="../../design_pattern/composite.html">
            
                    
                    1.6 组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../../design_pattern/facade.html">
            
                <a href="../../design_pattern/facade.html">
            
                    
                    1.7 门面模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.8" data-path="../../design_pattern/adapter.html">
            
                <a href="../../design_pattern/adapter.html">
            
                    
                    1.8 适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.9" data-path="../../design_pattern/decorator.html">
            
                <a href="../../design_pattern/decorator.html">
            
                    
                    1.9 装饰者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.10" data-path="../../design_pattern/flyweight.html">
            
                <a href="../../design_pattern/flyweight.html">
            
                    
                    1.10 享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.11" data-path="../../design_pattern/proxy.html">
            
                <a href="../../design_pattern/proxy.html">
            
                    
                    1.11 代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.12" data-path="../../design_pattern/middleware.html">
            
                <a href="../../design_pattern/middleware.html">
            
                    
                    1.12 中间件模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../network_prag/">
            
                <a href="../../network_prag/">
            
                    
                    2 网络编程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../network_prag/socket.html">
            
                <a href="../../network_prag/socket.html">
            
                    
                    2.1 长连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../network_prag/mq.html">
            
                <a href="../../network_prag/mq.html">
            
                    
                    2.2 MQ
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../../../program/">
            
                <a href="../../../program/">
            
                    
                    3 语言应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" data-path="../../../program/nodejs/node.html">
            
                <a href="../../../program/nodejs/node.html">
            
                    
                    3.1 Node.js
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1.1" data-path="../../../program/nodejs/core.html">
            
                <a href="../../../program/nodejs/core.html">
            
                    
                    3.1.1 原理及构成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.2" data-path="../../../program/nodejs/async.html">
            
                <a href="../../../program/nodejs/async.html">
            
                    
                    3.1.2 异步机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.3" data-path="../../../program/nodejs/important.html">
            
                <a href="../../../program/nodejs/important.html">
            
                    
                    3.1.3 一些核心概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.4" data-path="../../../program/nodejs/koa_web.html">
            
                <a href="../../../program/nodejs/koa_web.html">
            
                    
                    3.1.4 web应用: koa框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.5" data-path="../../../program/nodejs/koa.html">
            
                <a href="../../../program/nodejs/koa.html">
            
                    
                    3.1.5 koa源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.6" data-path="../../../program/nodejs/libuv.html">
            
                <a href="../../../program/nodejs/libuv.html">
            
                    
                    3.1.6 libuv网络库应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.7" data-path="../../../program/nodejs/apm.html">
            
                <a href="../../../program/nodejs/apm.html">
            
                    
                    3.1.7 性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.8" data-path="../../../program/nodejs/node_spider.html">
            
                <a href="../../../program/nodejs/node_spider.html">
            
                    
                    3.1.8 其他: Node爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.9" data-path="../../../program/nodejs/node_map_reduce.html">
            
                <a href="../../../program/nodejs/node_map_reduce.html">
            
                    
                    3.1.9 其他: Node编写Mapreduce
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" data-path="../../../program/c/c_and_plus.html">
            
                <a href="../../../program/c/c_and_plus.html">
            
                    
                    3.2 C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.2.1" data-path="../../../program/c/oop.html">
            
                <a href="../../../program/c/oop.html">
            
                    
                    3.2.1 面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.2" data-path="../../../program/c/ipcs.html">
            
                <a href="../../../program/c/ipcs.html">
            
                    
                    3.2.2 进程通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.3" data-path="../../../program/c/thread.html">
            
                <a href="../../../program/c/thread.html">
            
                    
                    3.2.3 线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.4" data-path="../../../program/c/memory.html">
            
                <a href="../../../program/c/memory.html">
            
                    
                    3.2.4 内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.5" data-path="../../../program/c/network.html">
            
                <a href="../../../program/c/network.html">
            
                    
                    3.2.5 网络编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.6" data-path="../../../program/c/build_tool.html">
            
                <a href="../../../program/c/build_tool.html">
            
                    
                    3.2.6 构建工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.7" data-path="../../../program/c/thread_pool.html">
            
                <a href="../../../program/c/thread_pool.html">
            
                    
                    3.2.7 其他: 线程池
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../">
            
                <a href="../">
            
                    
                    三 搭建部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../test.html">
            
                <a href="../test.html">
            
                    
                    3.1 测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1.1" data-path="../test/unit_testing.html">
            
                <a href="../test/unit_testing.html">
            
                    
                    3.1.1 单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.2" data-path="../test/stress_testing.html">
            
                <a href="../test/stress_testing.html">
            
                    
                    3.1.2 压力测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../ci_readme.html">
            
                <a href="../ci_readme.html">
            
                    
                    3.2 集成
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../ci/gitlab_ci.html">
            
                <a href="../ci/gitlab_ci.html">
            
                    
                    3.2.1 GitLab CI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../ci/spinnaker.html">
            
                <a href="../ci/spinnaker.html">
            
                    
                    3.2.2 Spinnaker
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../build.html">
            
                <a href="../build.html">
            
                    
                    3.3 部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="../k8s/k8s.html">
            
                <a href="../k8s/k8s.html">
            
                    
                    3.3.1 k8s
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.3.2" data-path="rancher.html">
            
                <a href="rancher.html">
            
                    
                    3.3.2 rancher
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="../swarm/swarm.html">
            
                <a href="../swarm/swarm.html">
            
                    
                    3.3.3 swarm
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../maintenance.html">
            
                <a href="../maintenance.html">
            
                    
                    3.4 监控
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.4.1" data-path="../monitor.html">
            
                <a href="../monitor.html">
            
                    
                    3.4.1 容器监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.2" data-path="../trace.html">
            
                <a href="../trace.html">
            
                    
                    3.4.2 系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3" data-path="../app1.md">
            
                <span>
            
                    
                    3.4.2 应用监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../../ha/ha.html">
            
                <a href="../../ha/ha.html">
            
                    
                    3.5 高可用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.5.1" data-path="../../ha/client.html">
            
                <a href="../../ha/client.html">
            
                    
                    3.5.1 接入层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.2" data-path="../../ha/service.html">
            
                <a href="../../ha/service.html">
            
                    
                    3.5.2 服务层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.3" data-path="../../ha/share.html">
            
                <a href="../../ha/share.html">
            
                    
                    3.5.3 存储层高可用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../hc/hc.html">
            
                <a href="../hc/hc.html">
            
                    
                    3.6 高并发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.6.1" data-path="../hc/dns.html">
            
                <a href="../hc/dns.html">
            
                    
                    3.6.1 基于DNS的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.2" data-path="../hc/lvs.html">
            
                <a href="../hc/lvs.html">
            
                    
                    3.6.2 基于Lvs的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.3" data-path="../hc/haproxy.html">
            
                <a href="../hc/haproxy.html">
            
                    
                    3.6.3 基于haproxy的负载均衡
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    四 架构模式
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" >
            
                <span>
            
                    
                    1 微服务架构设计与实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../../../program/java/spring-cloud.html">
            
                <a href="../../../program/java/spring-cloud.html">
            
                    
                    1.1 微服务概况
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../../../program/java/spring-eureka.html">
            
                <a href="../../../program/java/spring-eureka.html">
            
                    
                    1.2 服务注册及发现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="../../../program/java/spring-feign.html">
            
                <a href="../../../program/java/spring-feign.html">
            
                    
                    1.3 服务调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.4" data-path="../../../program/java/spring-zuul.html">
            
                <a href="../../../program/java/spring-zuul.html">
            
                    
                    1.4 网关及负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.5" data-path="../../../program/java/spring-hystrix.html">
            
                <a href="../../../program/java/spring-hystrix.html">
            
                    
                    1.5 熔断、限流、扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.6" data-path="../../../program/java/spring-config.html">
            
                <a href="../../../program/java/spring-config.html">
            
                    
                    1.6 云配置中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.7" data-path="../../../program/java/zipkin-tracing.html">
            
                <a href="../../../program/java/zipkin-tracing.html">
            
                    
                    1.7 分布式链路追踪
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.8" data-path="../../../program/java/swagger.html">
            
                <a href="../../../program/java/swagger.html">
            
                    
                    1.8 接口文档管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../../domain/">
            
                <a href="../../../domain/">
            
                    
                    2 领域驱动模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="../../../domain/domain.html">
            
                <a href="../../../domain/domain.html">
            
                    
                    2.1 领域--Domain
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.2" data-path="../../../domain/entity.md">
            
                <span>
            
                    
                    2.2 领域实体--Entity
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.3" data-path="../../../domain/object.html">
            
                <a href="../../../domain/object.html">
            
                    
                    2.3 值对象--Value Object
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.4" data-path="../../../domain/aggregate.html">
            
                <a href="../../../domain/aggregate.html">
            
                    
                    2.4 聚合--Aggregate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.5" data-path="../../../domain/service.html">
            
                <a href="../../../domain/service.html">
            
                    
                    2.5 服务--Services
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.6" data-path="../../../domain/event.html">
            
                <a href="../../../domain/event.html">
            
                    
                    2.6 领域事件--Event
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.7" data-path="../../../domain/framework.html">
            
                <a href="../../../domain/framework.html">
            
                    
                    2.7 几种常见的DDD架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" >
            
                <span>
            
                    
                    3 架构技术的演化与趋势
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" >
            
                <span>
            
                    
                    3.1 架构技术的发展历史及现状
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.2" >
            
                <span>
            
                    
                    3.2 Serverless无服务架构概念
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.3" >
            
                <span>
            
                    
                    3.3 ServerMesh网格服务概念
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    五 其他
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../../story/talk.html">
            
                <a href="../../../story/talk.html">
            
                    
                    5.1 小伙子,放松!
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >3.3.2 rancher</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x4E00;&#x3001;&#x7B80;&#x4ECB;">&#x4E00;&#x3001;&#x7B80;&#x4ECB;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;Rancher&#x662F;&#x4E00;&#x4E2A;&#x5F00;&#x6E90;&#x7684;&#x4F01;&#x4E1A;&#x7EA7;&#x5BB9;&#x5668;&#x7BA1;&#x7406;&#x5E73;&#x53F0;, &#x63D0;&#x4F9B;&#x57FA;&#x7840;&#x6027;&#x7684;&#x5BB9;&#x5668;&#x7F16;&#x6392;&#x4E0E;&#x8C03;&#x5EA6;&#x670D;&#x52A1;&#xFF0C;&#x5305;&#x62EC;&#x7F51;&#x7EDC;&#x3001;&#x5B58;&#x50A8;&#x3001;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x3001;DNS&#x548C;&#x5B89;&#x5168;&#x6A21;&#x5757;&#x7B49;&#xFF0C;&#x9664;&#x4E86;Swarm&#xFF0C;Kubernetes&#x548C;Mesos&#x4E4B;&#x5916;&#xFF0C;Rancher&#x8FD8;&#x652F;&#x6301;&#x81EA;&#x5DF1;&#x7684;Cattle&#x5BB9;&#x5668;&#x7F16;&#x6392;&#x8C03;&#x5EA6;&#x5F15;&#x64CE;&#x3002;Cattle&#x88AB;&#x5E7F;&#x6CDB;&#x7528;&#x4E8E;&#x7F16;&#x6392;Rancher&#x81EA;&#x5DF1;&#x7684;&#x57FA;&#x7840;&#x8BBE;&#x65BD;&#x670D;&#x52A1;&#x4EE5;&#x53CA;&#x7528;&#x4E8E;Swarm&#x96C6;&#x7FA4;&#xFF0C;Kubernetes&#x96C6;&#x7FA4;&#x548C;Mesos&#x96C6;&#x7FA4;&#x7684;&#x914D;&#x7F6E;&#x3002;</p>
<p>rancher&#x4F18;&#x52BF;</p>
<pre><code>A: &#x591A;&#x79CD;&#x8C03;&#x5EA6;&#x5668;&#xFF0C;&#x5BB9;&#x6613;&#x5730;&#x521B;&#x5EFA;&#x548C;&#x90E8;&#x7F72;Cattle&#x3001;Swarm&#x3001;K8S&#x3001;Mesos&#x5BB9;&#x5668;&#x96C6;&#x7FA4;&#x7BA1;&#x7406;&#x8C03;&#x5EA6;&#x5E73;&#x53F0;
B: &#x4FBF;&#x4E8E;&#x4E3B;&#x673A;&#x96C6;&#x7FA4;&#x7BA1;&#x7406;&#xFF0C;&#x7BA1;&#x7406;&#x5BF9;&#x8C61;&#x662F;&#x591A;&#x53F0;&#x4E3B;&#x673A;&#x7684;&#x96C6;&#x7FA4;
C: &#x5185;&#x7F6E;&#x5E94;&#x7528;&#x5546;&#x5E97;
</code></pre><ul>
<li>Rancher&#x529F;&#x80FD;&#x4E0E;&#x7EC4;&#x4EF6;
<img src="http://cdn.find-world.top/rancher_overview.png" alt="Rancher"></li>
</ul>
<hr>
<h3 id="&#x4E8C;&#x3001;&#x642D;&#x5EFA;">&#x4E8C;&#x3001;&#x642D;&#x5EFA;</h3>
<h4 id="&#x7EC4;&#x4EF6;&#x7B80;&#x4ECB;">&#x7EC4;&#x4EF6;&#x7B80;&#x4ECB;</h4>
<pre><code class="lang-text">1&#x3001;rancher: &#x5BB9;&#x5668;&#x7F16;&#x6392;&#x4E0E;&#x8C03;&#x5EA6;
2&#x3001;kong: &#x7F51;&#x5173;&#xFF0C;&#x5305;&#x62EC;&#x6743;&#x9650;&#x3001;&#x91CD;&#x8BD5;&#x3001;&#x63A5;&#x53E3;&#x7EDF;&#x8BA1;&#x3001;&#x63D2;&#x4EF6;&#x7B49;
3&#x3001;consul: &#x670D;&#x52A1;&#x53D1;&#x73B0;
4&#x3001;progres: &#x914D;&#x7F6E;kong&#x5B58;&#x50A8;
5&#x3001;ELK: &#x65E5;&#x5FD7;&#x6536;&#x96C6;&#x3001;&#x5206;&#x6790;&#x53CA;&#x53EF;&#x89C6;&#x5316;
6&#x3001;nfs: &#x6570;&#x636E;&#x5171;&#x4EAB;
</code></pre>
<ul>
<li>2.1 &#x5B89;&#x88C5;Rancher</li>
</ul>
<p>&#x5B89;&#x88C5;Rancher-server</p>
<pre><code class="lang-bash">sudo docker run <span class="hljs-_">-d</span> --restart=unless-stopped -p 8080:8080 rancher/server

&#x8BBF;&#x95EE;: http://&lt;SERVER_IP&gt;:8080
</code></pre>
<p>&#x914D;&#x7F6E;&#x4E3B;&#x673A;</p>
<p><img src="http://cdn.find-world.top/rancher_5.png" alt="Rancher"></p>
<ul>
<li>2.2 &#x5B89;&#x88C5;DNS</li>
</ul>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span> 
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  hdp4:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
<span class="hljs-attr">  hdp5:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
<span class="hljs-attr">  hdp1:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
<span class="hljs-attr">  hdp2:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
<span class="hljs-attr">  master:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
<span class="hljs-attr">  hdp3:</span>
<span class="hljs-attr">    image:</span> rancher/external-service
</code></pre>
<ul>
<li>2.3 &#x5B89;&#x88C5;Kong: &#x7F51;&#x5173;&#x5C42;&#x4EE3;&#x7406;&#x53CA;&#x8DEF;&#x7531;&#x6743;&#x9650;&#x63A7;&#x5236;&#x7B49;</li>
</ul>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  consul:</span>
<span class="hljs-attr">    mem_limit:</span> <span class="hljs-number">1073741824</span>
<span class="hljs-attr">    image:</span> progrium/consul:latest
<span class="hljs-attr">    dns:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">127.0</span><span class="hljs-number">.0</span><span class="hljs-number">.1</span>
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">8500</span>:<span class="hljs-number">8500</span>/tcp
<span class="hljs-attr">    expose:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;53&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;8300&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;8301&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;8302&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;8400&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;8500&apos;</span>
<span class="hljs-attr">    command:</span>
<span class="hljs-bullet">    -</span> -server
<span class="hljs-bullet">    -</span> -bootstrap
<span class="hljs-bullet">    -</span> -ui-dir
<span class="hljs-bullet">    -</span> /ui
<span class="hljs-attr">  kong-dashboard:</span>
<span class="hljs-attr">    image:</span> pgbi/kong-dashboard:v2
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> postgres/postgres:db-host
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">28808</span>:<span class="hljs-number">8080</span>/tcp
<span class="hljs-attr">    labels:</span>
      io.rancher.container.pull_image: always
      io.rancher.scheduler.global: <span class="hljs-string">&apos;true&apos;</span>
<span class="hljs-attr">  nginx-lb:</span>
<span class="hljs-attr">    mem_limit:</span> <span class="hljs-number">4294967296</span>
<span class="hljs-attr">    image:</span> dreamboat/kong-nginx-lb
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - consul:</span>consul
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">80</span>:<span class="hljs-number">8000</span>/tcp
<span class="hljs-bullet">    -</span> <span class="hljs-number">443</span>:<span class="hljs-number">8443</span>/tcp
<span class="hljs-bullet">    -</span> <span class="hljs-number">8001</span>:<span class="hljs-number">8001</span>/tcp
<span class="hljs-attr">    command:</span>
<span class="hljs-bullet">    -</span> /bin/containerpilot
<span class="hljs-bullet">    -</span> -config
<span class="hljs-attr">    - file:</span>///etc/containerpilot/containerpilot.json
<span class="hljs-bullet">    -</span> nginx
<span class="hljs-bullet">    -</span> -g
<span class="hljs-bullet">    -</span> daemon off;
<span class="hljs-attr">  kong:</span>
<span class="hljs-attr">    image:</span> dreamboat/docker-kong
<span class="hljs-attr">    environment:</span>
<span class="hljs-attr">      CLUSTER_LISTEN:</span> rancher
<span class="hljs-attr">      KONG_CASSANDRA_CONTACT_POINTS:</span> db-host
<span class="hljs-attr">      KONG_CASSANDRA_KEYSPACE:</span> kong
<span class="hljs-attr">      KONG_CASSANDRA_PASSWORD:</span> pgpassword!
<span class="hljs-attr">      KONG_CASSANDRA_USERNAME:</span> pguser
<span class="hljs-attr">      KONG_DATABASE:</span> postgres
<span class="hljs-attr">      KONG_PG_DATABASE:</span> kong
<span class="hljs-attr">      KONG_PG_HOST:</span> db-host
<span class="hljs-attr">      KONG_PG_PASSWORD:</span> pgpassword!
<span class="hljs-attr">      KONG_PG_PORT:</span> <span class="hljs-string">&apos;5432&apos;</span>
<span class="hljs-attr">      KONG_PG_USER:</span> pguser
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> postgres/postgres:db-host
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - consul:</span>consul
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">57797</span>:<span class="hljs-number">8000</span>/tcp
<span class="hljs-bullet">    -</span> <span class="hljs-number">54311</span>:<span class="hljs-number">8443</span>/tcp
<span class="hljs-bullet">    -</span> <span class="hljs-number">64612</span>:<span class="hljs-number">8001</span>/tcp
<span class="hljs-attr">    expose:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-string">&apos;7946&apos;</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">7946</span>/udp
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
      io.rancher.container.pull_image: always
      io.rancher.scheduler.global: <span class="hljs-string">&apos;true&apos;</span>
</code></pre>
<ul>
<li>2.4 &#x5B89;&#x88C5;postgres: kong&#x7B49;&#x914D;&#x7F6E;&#x5B58;&#x50A8;</li>
</ul>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  postgres-lb:</span>
<span class="hljs-attr">    image:</span> rancher/lb-service-haproxy
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">5432</span>:<span class="hljs-number">5432</span>/tcp
<span class="hljs-attr">    labels:</span>
      io.rancher.container.agent.role: environmentAdmin
      io.rancher.container.create_agent: <span class="hljs-string">&apos;true&apos;</span>
<span class="hljs-attr">  postgres-data:</span>
<span class="hljs-attr">    image:</span> busybox
<span class="hljs-attr">    volumes:</span>
<span class="hljs-bullet">    -</span> /var/lib/postgresql/data/pgdata:/var/lib/postgresql/data/pgdata
<span class="hljs-attr">    labels:</span>
      io.rancher.scheduler.affinity:host_label: zxg=node2
      io.rancher.container.start_once: <span class="hljs-string">&apos;true&apos;</span>
<span class="hljs-attr">  postgres:</span>
<span class="hljs-attr">    image:</span> postgres:latest
<span class="hljs-attr">    environment:</span>
<span class="hljs-attr">      PGDATA:</span> /var/lib/postgresql/data/pgdata
<span class="hljs-attr">      POSTGRES_DB:</span> postgres_sb
<span class="hljs-attr">      POSTGRES_PASSWORD:</span> pgpassword!
<span class="hljs-attr">      POSTGRES_USER:</span> pguser
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    volumes_from:</span>
<span class="hljs-bullet">    -</span> postgres-data
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">5432</span>:<span class="hljs-number">5432</span>/tcp
<span class="hljs-attr">    labels:</span>
      io.rancher.scheduler.affinity:host_label: zxg=node2
      io.rancher.sidekicks: postgres-data
</code></pre>
<ul>
<li>2.5 &#x5B89;&#x88C5;ELK: &#x65E5;&#x5FD7;&#x8FFD;&#x8E2A;&#x4E0E;&#x5B9A;&#x4F4D;&#x95EE;&#x9898;</li>
</ul>
<p>elasticsearch</p>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  elasticsearch1:</span>
<span class="hljs-attr">    mem_limit:</span> <span class="hljs-number">5000000000</span>
<span class="hljs-attr">    cap_add:</span>
<span class="hljs-bullet">    -</span> IPC_LOCK
<span class="hljs-attr">    image:</span> elasticsearch:<span class="hljs-number">5.3</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    environment:</span>
<span class="hljs-attr">      ES_JAVA_OPTS:</span> -Xms512m -Xmx512m
      bootstrap.memory_lock: <span class="hljs-string">&apos;true&apos;</span>
      cluster.name: docker-cluster
      xpack.security.enabled: <span class="hljs-string">&apos;false&apos;</span>
<span class="hljs-attr">    ulimits:</span>
<span class="hljs-attr">      memlock:</span>
<span class="hljs-attr">        hard:</span> <span class="hljs-bullet">-1</span>
<span class="hljs-attr">        soft:</span> <span class="hljs-bullet">-1</span>
<span class="hljs-attr">    volumes:</span>
<span class="hljs-attr">    - zxg_elasticsearch1:</span>/usr/share/elasticsearch/data
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">19200</span>:<span class="hljs-number">9200</span>/tcp
<span class="hljs-bullet">    -</span> <span class="hljs-number">19300</span>:<span class="hljs-number">9300</span>/tcp
<span class="hljs-attr">    labels:</span>
      io.rancher.scheduler.affinity:host_label: zxg=node1
<span class="hljs-attr">  elasticsearch2:</span>
<span class="hljs-attr">    mem_limit:</span> <span class="hljs-number">5000000000</span>
<span class="hljs-attr">    cap_add:</span>
<span class="hljs-bullet">    -</span> IPC_LOCK
<span class="hljs-attr">    image:</span> elasticsearch:<span class="hljs-number">5.3</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    environment:</span>
<span class="hljs-attr">      ES_JAVA_OPTS:</span> -Xms512m -Xmx512m
      bootstrap.memory_lock: <span class="hljs-string">&apos;true&apos;</span>
      cluster.name: docker-cluster
      discovery.zen.ping.unicast.hosts: elasticsearch1
      xpack.security.enabled: <span class="hljs-string">&apos;false&apos;</span>
<span class="hljs-attr">    ulimits:</span>
<span class="hljs-attr">      memlock:</span>
<span class="hljs-attr">        hard:</span> <span class="hljs-bullet">-1</span>
<span class="hljs-attr">        soft:</span> <span class="hljs-bullet">-1</span>
<span class="hljs-attr">    volumes:</span>
<span class="hljs-bullet">    -</span> /usr/share/elasticsearch/data:/usr/share/elasticsearch/data
<span class="hljs-attr">    labels:</span>
      io.rancher.scheduler.affinity:host_label: zxg=node1
</code></pre>
<p>logstash</p>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  logstash-collector-config:</span>
<span class="hljs-attr">    image:</span> rancher/logstash-config:v0<span class="hljs-number">.2</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - redis:</span>redis
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  logstash-collector:</span>
<span class="hljs-attr">    image:</span> logstash:<span class="hljs-number">5.1</span><span class="hljs-number">.1</span>-alpine
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - redis:</span>redis
<span class="hljs-attr">    volumes_from:</span>
<span class="hljs-bullet">    -</span> logstash-collector-config
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">56297</span>:<span class="hljs-number">5000</span>/udp
<span class="hljs-bullet">    -</span> <span class="hljs-number">55215</span>:<span class="hljs-number">6000</span>/tcp
<span class="hljs-attr">    command:</span>
<span class="hljs-bullet">    -</span> logstash
<span class="hljs-bullet">    -</span> -f
<span class="hljs-bullet">    -</span> /etc/logstash
<span class="hljs-attr">    labels:</span>
      io.rancher.sidekicks: logstash-collector-config
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  logstash-indexer:</span>
<span class="hljs-attr">    image:</span> logstash:<span class="hljs-number">5.1</span><span class="hljs-number">.1</span>-alpine
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> elasticsearch/elasticsearch1:elasticsearch
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - redis:</span>redis
<span class="hljs-attr">    volumes_from:</span>
<span class="hljs-bullet">    -</span> logstash-indexer-config
<span class="hljs-attr">    command:</span>
<span class="hljs-bullet">    -</span> logstash
<span class="hljs-bullet">    -</span> -f
<span class="hljs-bullet">    -</span> /etc/logstash
<span class="hljs-attr">    labels:</span>
      io.rancher.sidekicks: logstash-indexer-config
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  redis:</span>
<span class="hljs-attr">    image:</span> redis:<span class="hljs-number">3.2</span><span class="hljs-number">.6</span>-alpine
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  logstash-indexer-config:</span>
<span class="hljs-attr">    image:</span> rancher/logstash-config:v0<span class="hljs-number">.2</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> elasticsearch/elasticsearch1:elasticsearch
<span class="hljs-attr">    links:</span>
<span class="hljs-attr">    - redis:</span>redis
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
</code></pre>
<p>kibana</p>
<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">  nginx-proxy:</span>
<span class="hljs-attr">    image:</span> rancher/nginx:v1<span class="hljs-number">.9</span><span class="hljs-number">.4</span><span class="hljs-bullet">-3</span>
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> elasticsearch/elasticsearch1:elasticsearch
<span class="hljs-attr">    volumes_from:</span>
<span class="hljs-bullet">    -</span> nginx-proxy-conf
<span class="hljs-attr">    labels:</span>
      io.rancher.sidekicks: nginx-proxy-conf,kibana5
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  kibana-vip:</span>
<span class="hljs-attr">    image:</span> rancher/lb-service-haproxy:v0<span class="hljs-number">.7</span><span class="hljs-number">.5</span>
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    ports:</span>
<span class="hljs-bullet">    -</span> <span class="hljs-number">29200</span>:<span class="hljs-number">29200</span>/tcp
<span class="hljs-attr">    labels:</span>
      io.rancher.container.agent.role: environmentAdmin
      io.rancher.container.create_agent: <span class="hljs-string">&apos;true&apos;</span>
<span class="hljs-attr">  nginx-proxy-conf:</span>
<span class="hljs-attr">    image:</span> rancher/nginx-conf:v0<span class="hljs-number">.2</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> elasticsearch/elasticsearch1:elasticsearch
<span class="hljs-attr">    command:</span>
<span class="hljs-bullet">    -</span> -backend=rancher
<span class="hljs-bullet">    -</span> --prefix=/<span class="hljs-number">2015</span><span class="hljs-bullet">-07</span><span class="hljs-bullet">-25</span>
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
<span class="hljs-attr">  kibana5:</span>
<span class="hljs-attr">    image:</span> kibana:<span class="hljs-number">5.3</span><span class="hljs-number">.0</span>
<span class="hljs-attr">    environment:</span>
<span class="hljs-attr">      ELASTICSEARCH_URL:</span> http://elasticsearch:<span class="hljs-number">9200</span>
<span class="hljs-attr">    stdin_open:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    external_links:</span>
<span class="hljs-bullet">    -</span> elasticsearch/elasticsearch1:elasticsearch
<span class="hljs-attr">    network_mode:</span> container:nginx-proxy
<span class="hljs-attr">    tty:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    labels:</span>
      io.rancher.container.hostname_override: container_name
</code></pre>
<ul>
<li>nfs<pre><code class="lang-yml"><span class="hljs-attr">version:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">services:</span>
<span class="hljs-attr">nfs-driver:</span>
<span class="hljs-attr">  privileged:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">  image:</span> rancher/storage-nfs:v0<span class="hljs-number">.8</span><span class="hljs-number">.3</span>
<span class="hljs-attr">  environment:</span>
<span class="hljs-attr">    MOUNT_DIR:</span> /mnt/nfs
<span class="hljs-attr">    MOUNT_OPTS:</span> <span class="hljs-string">&apos;,nfsvers=4&apos;</span>
<span class="hljs-attr">    NFS_SERVER:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.150</span><span class="hljs-number">.172</span>
<span class="hljs-attr">    RANCHER_DEBUG:</span> <span class="hljs-string">&apos;false&apos;</span>
<span class="hljs-attr">  volumes:</span>
<span class="hljs-bullet">  -</span> /run:/run
<span class="hljs-bullet">  -</span> /var/run:/var/run
<span class="hljs-bullet">  -</span> /dev:/host/dev
<span class="hljs-bullet">  -</span> /var/lib/rancher/volumes:/var/lib/rancher/volumes:shared
<span class="hljs-attr">  logging:</span>
<span class="hljs-attr">    driver:</span> json-file
<span class="hljs-attr">    options:</span>
<span class="hljs-attr">      max-file:</span> <span class="hljs-string">&apos;2&apos;</span>
<span class="hljs-attr">      max-size:</span> <span class="hljs-number">25</span>m
<span class="hljs-attr">  pid:</span> host
<span class="hljs-attr">  labels:</span>
    io.rancher.container.agent.role: environment
    io.rancher.container.create_agent: <span class="hljs-string">&apos;true&apos;</span>
    io.rancher.scheduler.global: <span class="hljs-string">&apos;true&apos;</span>
</code></pre>
</li>
</ul>
<p><img src="http://oll2iao6w.bkt.clouddn.com/rancher_4.png" alt="Rancher"></p>
<hr>
<h3 id="&#x4E09;&#x3001;&#x90E8;&#x7F72;&#x5B9E;&#x4F8B;">&#x4E09;&#x3001;&#x90E8;&#x7F72;&#x5B9E;&#x4F8B;</h3>
<ul>
<li>&#x901A;&#x8FC7;Rancher&#x90E8;&#x7F72;&#x53CC;&#x6D3B;&#x955C;&#x50CF;</li>
</ul>
<p><img src="http://cdn.find-world.top/rancher_result_1.png" alt="Rancher"></p>
<ul>
<li><p>&#x8C03;&#x7528;&#x63A5;&#x53E3;
<img src="http://cdn.find-world.top/rancher_result.png" alt="Rancher"></p>
</li>
<li><p>&#x505C;&#x7528;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x955C;&#x50CF;
<img src="http://cdn.find-world.top/rancher_result_2.png" alt="Rancher"></p>
</li>
<li><p>&#x8C03;&#x7528;&#x63A5;&#x53E3;
<img src="http://cdn.find-world.top/rancher_result.png" alt="Rancher"></p>
</li>
</ul>
<hr>
<h3 id="&#x56DB;&#x3001;&#x9002;&#x7528;&#x573A;&#x666F;">&#x56DB;&#x3001;&#x9002;&#x7528;&#x573A;&#x666F;</h3>
<pre><code>1: &#x590D;&#x6742;&#x6570;&#x636E;&#x4E2D;&#x5FC3;&#x53CA;&#x6DF7;&#x5408;&#x4E91;&#x7B49;
2: &#x591A;&#x73AF;&#x5883;&#x3001;&#x591A;&#x8D44;&#x6E90;&#x6C60;&#x7684;DevOps
3: &#x8F7B;&#x91CF;&#x7EA7;PaaS, &#x7279;&#x522B;&#x662F;&#x521B;&#x4E1A;&#x516C;&#x53F8;
</code></pre><hr>
<h3 id="&#x4E94;&#x3001;&#x53C2;&#x8003;">&#x4E94;&#x3001;&#x53C2;&#x8003;</h3>
<ul>
<li><a href="http://rancher.com/docs/rancher/v1.6/zh/" target="_blank">Rancher&#x6587;&#x6863;</a></li>
<li><a href="https://github.com/Kong/kong" target="_blank">Kong&#x5730;&#x5740;</a></li>
<li><a href="https://github.com/hashicorp/consul" target="_blank">Consul&#x5730;&#x5740;</a></li>
<li><a href="https://github.com/elastic/elasticsearch" target="_blank">Elasticsearch</a></li>
<li><a href="https://github.com/elastic/logstash" target="_blank">Logstash</a></li>
<li><a href="https://github.com/elastic/Kibana" target="_blank">Kibana</a></li>
</ul>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x4E00;&#x84D1;&#x70DF;&#x96E8;&#x4EFB;&#x5E73;&#x751F; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x4FEE;&#x6539;&#x65F6;&#x95F4;: 
2021-04-09 11:09:03
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../k8s/k8s.html" class="navigation navigation-prev " aria-label="Previous page: 3.3.1 k8s">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../swarm/swarm.html" class="navigation navigation-next " aria-label="Next page: 3.3.3 swarm">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.3.2 rancher","level":"1.4.3.2","depth":3,"next":{"title":"3.3.3 swarm","level":"1.4.3.3","depth":3,"path":"engineering/ci_deplopment/swarm/swarm.md","ref":"engineering/ci_deplopment/swarm/swarm.md","articles":[]},"previous":{"title":"3.3.1 k8s","level":"1.4.3.1","depth":3,"path":"engineering/ci_deplopment/k8s/k8s.md","ref":"engineering/ci_deplopment/k8s/k8s.md","articles":[]},"dir":"ltr"},"config":{"plugins":["disqus","tree","splitter","local-video","chart","github-buttons","tbfed-pagefooter","ace","katex"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 一蓑烟雨任平生","modify_label":"修改时间: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"ace":{},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"repo":"TIME-GATE/","types":["star","watch"],"size":"large"},"local-video":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"tree":{},"chart":{"type":"c3"}},"theme":"default","author":"zq_sdk@163.com","name":"name","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Ebook","language":"zh-hans","gitbook":"*","description":"电子书"},"file":{"path":"engineering/ci_deplopment/rancher/rancher.md","mtime":"2021-04-09T03:09:03.405Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-10T12:23:44.633Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-tree/jquery.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-tree/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

